<html>
<head><meta charset="utf-8"><title>target features documentation #63597 · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html">target features documentation #63597</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="174465134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174465134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174465134">(Aug 29 2019 at 15:32)</a>:</h4>
<p>Creating this issue to discuss <a href="https://github.com/rust-lang/rust/issues/63597" target="_blank" title="https://github.com/rust-lang/rust/issues/63597">#63597</a>. <span class="user-mention" data-user-id="237257">@Sergey Togi Dashnyam</span> -- feel free to ask some questions here :)</p>



<a name="174465153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174465153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174465153">(Aug 29 2019 at 15:32)</a>:</h4>
<p>Though I'll try to leave a few more notes about what's expected in the issue itself</p>



<a name="174465215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174465215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174465215">(Aug 29 2019 at 15:33)</a>:</h4>
<p>One thing you <em>can</em> do btw is ask the triagebot to assign you; I think it's <code>@rustbot claim</code></p>



<a name="174465288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174465288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sergey Togi Dashnyam <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174465288">(Aug 29 2019 at 15:34)</a>:</h4>
<p>Ok, I'm currently reading linked issues</p>



<a name="174465307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174465307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sergey Togi Dashnyam <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174465307">(Aug 29 2019 at 15:34)</a>:</h4>
<p>as I have no context atm</p>



<a name="174465521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174465521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sergey Togi Dashnyam <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174465521">(Aug 29 2019 at 15:36)</a>:</h4>
<p>Let me read the entire history and <br>
I'll restate what my understanding of this issue is</p>



<a name="174467701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174467701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sergey Togi Dashnyam <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174467701">(Aug 29 2019 at 16:03)</a>:</h4>
<p>SITUATION:<br>
  Rust's Target feature leads to segfaults.</p>
<p>PROBLEM:<br>
1. Rust has a Target feature for different CPU architectures. Binaries for e.g. ARM, x86 architectures differ, since they have different CPU instruction sets.<br>
2. Using the target feature under certain conditions* is atm unsafe, because<br>
            - floats are compiled to soft-floats (software emulated floats) <br>
            -- OR --<br>
            - native floats (used via ABIs --&gt; goes to Floating Processing Unit)<br>
           * w/ target being set not via CLI but Rust code + on x86_64-unknown-linux-gnu</p>
<p>Problem: <br>
            - mixed usage leads to segfault (trying to access reserved memory).<br>
            - using crates will result in mixed usage, too</p>
<p>SOLUTION:<br>
           - There is no quick solution, but documenting stuff is always good.</p>
<div class="codehilite"><pre><span></span>       FILES TO MODIFY:
                (... will come in next posting)
</pre></div>



<a name="174470738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174470738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sergey Togi Dashnyam <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174470738">(Aug 29 2019 at 16:43)</a>:</h4>
<p>The docfiles to modify are:</p>
<h1>RustC Docs</h1>
<ul>
<li>Link: <a href="https://doc.rust-lang.org/rustc/targets/built-in.html" target="_blank" title="https://doc.rust-lang.org/rustc/targets/built-in.html">https://doc.rust-lang.org/rustc/targets/built-in.html</a></li>
<li>Src: <a href="https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/targets/built-in.md" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/targets/built-in.md">https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/targets/built-in.md</a></li>
</ul>
<h5>Question <span class="user-mention" data-user-id="116009">@nikomatsakis</span></h5>
<ul>
<li>Do you want me to edit <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/x86_64_unknown_linux_gnu/index.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/x86_64_unknown_linux_gnu/index.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/x86_64_unknown_linux_gnu/index.html</a> too?</li>
<li>are there any other places, which need hints / updates?</li>
</ul>
<h1>-Chelp</h1>
<ul>
<li>Link: ?</li>
<li>Source: ?</li>
</ul>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  where do I find the -Chelp files?</p>



<a name="174565399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174565399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174565399">(Aug 30 2019 at 17:28)</a>:</h4>
<p><span class="user-mention" data-user-id="237257">@Sergey Togi Dashnyam</span> heh I'm not sure -- there's some macro somewhere</p>



<a name="174565466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174565466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174565466">(Aug 30 2019 at 17:29)</a>:</h4>
<p>ah, <a href="https://github.com/rust-lang/rust/blob/0f4140169162f6de69e2af7df616e02b75735207/src/librustc/session/config.rs#L1136-L1138" target="_blank" title="https://github.com/rust-lang/rust/blob/0f4140169162f6de69e2af7df616e02b75735207/src/librustc/session/config.rs#L1136-L1138">here it is</a></p>



<a name="174565587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174565587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174565587">(Aug 30 2019 at 17:30)</a>:</h4>
<p>it looks like <code>--print target-features</code> winds up <a href="https://github.com/rust-lang/rust/blob/0f4140169162f6de69e2af7df616e02b75735207/src/librustc/session/config.rs#L2377" target="_blank" title="https://github.com/rust-lang/rust/blob/0f4140169162f6de69e2af7df616e02b75735207/src/librustc/session/config.rs#L2377">somewhere around this code</a></p>



<a name="174578431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174578431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sergey Togi Dashnyam <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174578431">(Aug 30 2019 at 20:07)</a>:</h4>
<p>Thanks, will do a draft PR on the weekend.</p>



<a name="174880075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174880075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sergey Togi Dashnyam <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174880075">(Sep 04 2019 at 13:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I created a PR <a href="https://github.com/rust-lang/rust/pull/64145" target="_blank" title="https://github.com/rust-lang/rust/pull/64145">https://github.com/rust-lang/rust/pull/64145</a></p>



<a name="174885081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/target%20features%20documentation%20%2363597/near/174885081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/target.20features.20documentation.20.2363597.html#174885081">(Sep 04 2019 at 14:06)</a>:</h4>
<p><span class="user-mention" data-user-id="237257">@Sergey Togi Dashnyam</span> awesome! <span aria-label="heart eyes" class="emoji emoji-1f60d" role="img" title="heart eyes">:heart_eyes:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>